<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>发起请求</button>
    <!-- <script src="./03.Promise基本用法.js"></script> -->
    <script src="./Promise封装请求方式.js"></script>

    <script>
        const btn = document.querySelector('button')
        btn.addEventListener('click', 
        async function () {
            const data={bookname:"三国杀",author:"汪苏泷",publisher:"浙江传媒音乐学院"}
        const url= 'http://ajax-base-api-t.itheima.net/api/getbooks'
        Promise.all([ harryAjax({ method: 'GET', url })],
        [harryAjax({ method: 'POST',data, url })]
        ).then(res=>{
             document.querySelector('body').innerHTML="<h1>欢迎进入界面</h1>"
            })
            .catch(err=>{
                document.querySelector('body').innerHTML=err
            })
 
        })
   
    </script>
</body>

</html>